


<!doctype html>
<html lang="zh" class="no-js">
  <head>
    
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width,initial-scale=1">
      
      
        <link rel="canonical" href="https://gitee.io/docker/install/">
      
      
        <meta name="author" content="anonymous">
      
      <link rel="shortcut icon" href="../../img/facio.ico">
      <meta name="generator" content="mkdocs-1.1.2, mkdocs-material-5.3.3">
    
    
      
        <title>docker 环境安装 - My Docs</title>
      
    
    
      <link rel="stylesheet" href="../../assets/stylesheets/main.fe0cca5b.min.css">
      
        <link rel="stylesheet" href="../../assets/stylesheets/palette.a46bcfb3.min.css">
      
      
        
        
        <meta name="theme-color" content="#4caf50">
      
    
    
    
      
        <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
        <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
        <style>body,input{font-family:"Roboto",-apple-system,BlinkMacSystemFont,Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono",SFMono-Regular,Consolas,Menlo,monospace}</style>
      
    
    
    
      <link rel="stylesheet" href="../../css/extra.css">
    
    
      
        
<script>window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)},ga.l=+new Date,ga("create","UA-147297392-3","docs.jumpserver.org"),ga("set","anonymizeIp",!0),ga("send","pageview"),document.addEventListener("DOMContentLoaded",function(){document.forms.search&&document.forms.search.query.addEventListener("blur",function(){if(this.value){var e=document.location.pathname;ga("send","pageview",e+"?q="+this.value)}})}),document.addEventListener("DOMContentSwitch",function(){ga("send","pageview")})</script>
<script async src="https://www.google-analytics.com/analytics.js"></script>
      
    
    
  </head>
  
  
    
    
    
    <body dir="ltr" data-md-color-scheme="" data-md-color-primary="green" data-md-color-accent="red">
  
    
    <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
    <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
    <label class="md-overlay" for="__drawer"></label>
    <div data-md-component="skip">
      
        
        <a href="#docker" class="md-skip">
          跳转至
        </a>
      
    </div>
    <div data-md-component="announce">
      
    </div>
    
      <header class="md-header" data-md-component="header">
  <nav class="md-header-nav md-grid" aria-label="Header">
    <a href="https://gitee.io" title="My Docs" class="md-header-nav__button md-logo" aria-label="My Docs">
      
  
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 003-3 3 3 0 00-3-3 3 3 0 00-3 3 3 3 0 003 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54z"/></svg>

    </a>
    <label class="md-header-nav__button md-icon" for="__drawer">
      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z"/></svg>
    </label>
    <div class="md-header-nav__title" data-md-component="header-title">
      
        <div class="md-header-nav__ellipsis">
          <span class="md-header-nav__topic md-ellipsis">
            My Docs
          </span>
          <span class="md-header-nav__topic md-ellipsis">
            
              docker 环境安装
            
          </span>
        </div>
      
    </div>
    
      <label class="md-header-nav__button md-icon" for="__search">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
      </label>
      
<div class="md-search" data-md-component="search" role="dialog">
  <label class="md-search__overlay" for="__search"></label>
  <div class="md-search__inner" role="search">
    <form class="md-search__form" name="search">
      <input type="text" class="md-search__input" name="query" aria-label="搜索" placeholder="搜索" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" data-md-state="active">
      <label class="md-search__icon md-icon" for="__search">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
      </label>
      <button type="reset" class="md-search__icon md-icon" aria-label="Clear" data-md-component="search-reset" tabindex="-1">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>
      </button>
    </form>
    <div class="md-search__output">
      <div class="md-search__scrollwrap" data-md-scrollfix>
        <div class="md-search-result" data-md-component="search-result">
          <div class="md-search-result__meta">
            Initializing search
          </div>
          <ol class="md-search-result__list"></ol>
        </div>
      </div>
    </div>
  </div>
</div>
    
    
      <div class="md-header-nav__source">
        
<a href="https://gitee.com" title="前往 GitHub 仓库" class="md-source">
  <div class="md-source__icon md-icon">
    
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M439.55 236.05L244 40.45a28.87 28.87 0 00-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 01-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 000 40.81l195.61 195.6a28.86 28.86 0 0040.8 0l194.69-194.69a28.86 28.86 0 000-40.81z"/></svg>
  </div>
  <div class="md-source__repository">
    Gitee Star
  </div>
</a>
      </div>
    
  </nav>
</header>
    
    <div class="md-container" data-md-component="container">
      
        
      
      
        
      
      <main class="md-main" data-md-component="main">
        <div class="md-main__inner md-grid">
          
            
              <div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
                <div class="md-sidebar__scrollwrap">
                  <div class="md-sidebar__inner">
                    <nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
  <label class="md-nav__title" for="__drawer">
    <a href="https://gitee.io" title="My Docs" class="md-nav__button md-logo" aria-label="My Docs">
      
  
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 003-3 3 3 0 00-3-3 3 3 0 00-3 3 3 3 0 003 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54z"/></svg>

    </a>
    My Docs
  </label>
  
    <div class="md-nav__source">
      
<a href="https://gitee.com" title="前往 GitHub 仓库" class="md-source">
  <div class="md-source__icon md-icon">
    
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M439.55 236.05L244 40.45a28.87 28.87 0 00-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 01-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 000 40.81l195.61 195.6a28.86 28.86 0 0040.8 0l194.69-194.69a28.86 28.86 0 000-40.81z"/></svg>
  </div>
  <div class="md-source__repository">
    Gitee Star
  </div>
</a>
    </div>
  
  <ul class="md-nav__list" data-md-scrollfix>
    
      
      
      


  <li class="md-nav__item">
    <a href="../.." title="总体介绍" class="md-nav__link">
      总体介绍
    </a>
  </li>

    
      
      
      

  


  <li class="md-nav__item md-nav__item--active md-nav__item--nested">
    
      <input class="md-nav__toggle md-toggle" data-md-toggle="nav-2" type="checkbox" id="nav-2" checked>
    
    <label class="md-nav__link" for="nav-2">
      Docker 服务部署
      <span class="md-nav__icon md-icon">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>
      </span>
    </label>
    <nav class="md-nav" aria-label="Docker 服务部署" data-md-level="1">
      <label class="md-nav__title" for="nav-2">
        <span class="md-nav__icon md-icon">
          <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
        </span>
        Docker 服务部署
      </label>
      <ul class="md-nav__list" data-md-scrollfix>
        
        
          
          
          

  


  <li class="md-nav__item md-nav__item--active">
    
    <input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
    
      
    
    
      <label class="md-nav__link md-nav__link--active" for="__toc">
        docker 环境安装
        <span class="md-nav__icon md-icon">
          <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 9h14V7H3v2m0 4h14v-2H3v2m0 4h14v-2H3v2m16 0h2v-2h-2v2m0-10v2h2V7h-2m0 6h2v-2h-2v2z"/></svg>
        </span>
      </label>
    
    <a href="./" title="docker 环境安装" class="md-nav__link md-nav__link--active">
      docker 环境安装
    </a>
    
      
<nav class="md-nav md-nav--secondary" aria-label="目录">
  
  
    
  
  
    <label class="md-nav__title" for="__toc">
      <span class="md-nav__icon md-icon">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
      </span>
      目录
    </label>
    <ul class="md-nav__list" data-md-scrollfix>
      
        <li class="md-nav__item">
  <a href="#yum-docker" class="md-nav__link">
    Yum 安装 Docker
  </a>
  
    <nav class="md-nav" aria-label="Yum 安装 Docker">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#1" class="md-nav__link">
    1. 关闭 &amp;&amp; 禁用 防火墙
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#2-selinux" class="md-nav__link">
    2. 关闭 &amp;&amp; 禁用 Selinux
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#3-docker" class="md-nav__link">
    3. 添加 Docker 软件源
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#4-docker-ce" class="md-nav__link">
    4. 安装 Docker CE
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#5-docker" class="md-nav__link">
    5. 创建 Docker 配置文件
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#6-docker" class="md-nav__link">
    6. 启动 Docker 服务并设置开机启动
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#7" class="md-nav__link">
    7. 安装命令补全
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
      
        <li class="md-nav__item">
  <a href="#docker_1" class="md-nav__link">
    二进制安装 Docker
  </a>
  
    <nav class="md-nav" aria-label="二进制安装 Docker">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#1_1" class="md-nav__link">
    1. 关闭 &amp;&amp; 禁用 防火墙
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#2-selinux_1" class="md-nav__link">
    2. 关闭 &amp;&amp; 禁用 Selinux
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#3" class="md-nav__link">
    3. 获取最新稳定版本号
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#4" class="md-nav__link">
    4. 下载二进制安装包
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#5" class="md-nav__link">
    5. 解压 &amp;&amp; 配置
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#6" class="md-nav__link">
    6. 创建服务
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#7-docker" class="md-nav__link">
    7. 启动 Docker 服务并设置开机启动
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#8" class="md-nav__link">
    8. 配置命令补全
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
      
        <li class="md-nav__item">
  <a href="#docker-compose" class="md-nav__link">
    二进制安装 docker-compose
  </a>
  
    <nav class="md-nav" aria-label="二进制安装 docker-compose">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#1_2" class="md-nav__link">
    1. 获取最新版本号
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#2" class="md-nav__link">
    2. 下载 &amp;&amp; 安装
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#3_1" class="md-nav__link">
    3. 配置命令补全
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
      
        <li class="md-nav__item">
  <a href="#_1" class="md-nav__link">
    使用脚本安装(二进制)
  </a>
  
    <nav class="md-nav" aria-label="使用脚本安装(二进制)">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#1-docker-ce" class="md-nav__link">
    1. 安装 Docker CE
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#2-docker-compose" class="md-nav__link">
    2. 安装 docker-compose
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
      
    </ul>
  
</nav>
    
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../harbor/" title="harbor 安装" class="md-nav__link">
      harbor 安装
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../kubeadm.md" title="Kubeadm 安装 Kubernetes 集群" class="md-nav__link">
      Kubeadm 安装 Kubernetes 集群
    </a>
  </li>

        
      </ul>
    </nav>
  </li>

    
      
      
      


  <li class="md-nav__item md-nav__item--nested">
    
      <input class="md-nav__toggle md-toggle" data-md-toggle="nav-3" type="checkbox" id="nav-3">
    
    <label class="md-nav__link" for="nav-3">
      Linux 服务部署
      <span class="md-nav__icon md-icon">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>
      </span>
    </label>
    <nav class="md-nav" aria-label="Linux 服务部署" data-md-level="1">
      <label class="md-nav__title" for="nav-3">
        <span class="md-nav__icon md-icon">
          <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
        </span>
        Linux 服务部署
      </label>
      <ul class="md-nav__list" data-md-scrollfix>
        
        
          
          
          


  <li class="md-nav__item">
    <a href="../../linux/zookeeper.md" title="zookeeper 部署" class="md-nav__link">
      zookeeper 部署
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../linux/kafka.md" title="kafka 部署" class="md-nav__link">
      kafka 部署
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../linux/hadoop.md" title="hadoop 部署" class="md-nav__link">
      hadoop 部署
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../linux/hbase.md" title="hbase 部署" class="md-nav__link">
      hbase 部署
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../linux/apache-storm.md" title="apache-storm 部署" class="md-nav__link">
      apache-storm 部署
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../linux/opentsdb.md" title="opentsdb 部署" class="md-nav__link">
      opentsdb 部署
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../linux/mysql.md" title="mysql 部署" class="md-nav__link">
      mysql 部署
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../linux/redis.md" title="redis 部署" class="md-nav__link">
      redis 部署
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../linux/fastdfs.md" title="fastdfs 部署" class="md-nav__link">
      fastdfs 部署
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../linux/nginx.md" title="nginx 部署" class="md-nav__link">
      nginx 部署
    </a>
  </li>

        
      </ul>
    </nav>
  </li>

    
      
      
      


  <li class="md-nav__item md-nav__item--nested">
    
      <input class="md-nav__toggle md-toggle" data-md-toggle="nav-4" type="checkbox" id="nav-4">
    
    <label class="md-nav__link" for="nav-4">
      安装配置
      <span class="md-nav__icon md-icon">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>
      </span>
    </label>
    <nav class="md-nav" aria-label="安装配置" data-md-level="1">
      <label class="md-nav__title" for="nav-4">
        <span class="md-nav__icon md-icon">
          <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
        </span>
        安装配置
      </label>
      <ul class="md-nav__list" data-md-scrollfix>
        
        
          
          
          


  <li class="md-nav__item">
    <a href="../../install/step_by_step/" title="安装文档" class="md-nav__link">
      安装文档
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../install/setup_by_fast/" title="极速部署" class="md-nav__link">
      极速部署
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../install/docker_install/" title="容器部署" class="md-nav__link">
      容器部署
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item md-nav__item--nested">
    
      <input class="md-nav__toggle md-toggle" data-md-toggle="nav-4-4" type="checkbox" id="nav-4-4">
    
    <label class="md-nav__link" for="nav-4-4">
      分布式部署
      <span class="md-nav__icon md-icon">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>
      </span>
    </label>
    <nav class="md-nav" aria-label="分布式部署" data-md-level="2">
      <label class="md-nav__title" for="nav-4-4">
        <span class="md-nav__icon md-icon">
          <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
        </span>
        分布式部署
      </label>
      <ul class="md-nav__list" data-md-scrollfix>
        
        
          
          
          


  <li class="md-nav__item">
    <a href="../../install/setup_by_prod/" title="环境说明" class="md-nav__link">
      环境说明
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../install/prod/distributed_01/" title="NFS 部署" class="md-nav__link">
      NFS 部署
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../install/prod/distributed_02/" title="Tengine 部署" class="md-nav__link">
      Tengine 部署
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../install/prod/distributed_03/" title="Mariadb 部署" class="md-nav__link">
      Mariadb 部署
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../install/prod/distributed_04/" title="Redis 部署" class="md-nav__link">
      Redis 部署
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../install/prod/distributed_05/" title="Core 部署" class="md-nav__link">
      Core 部署
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../install/prod/distributed_06/" title="Koko 部署" class="md-nav__link">
      Koko 部署
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../install/prod/distributed_07/" title="Guacamole 部署" class="md-nav__link">
      Guacamole 部署
    </a>
  </li>

        
      </ul>
    </nav>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../install/ansible_install/" title="Ansible 部署" class="md-nav__link">
      Ansible 部署
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../install/install_security/" title="安全建议" class="md-nav__link">
      安全建议
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../install/uninstall/" title="卸载文档" class="md-nav__link">
      卸载文档
    </a>
  </li>

        
      </ul>
    </nav>
  </li>

    
      
      
      


  <li class="md-nav__item md-nav__item--nested">
    
      <input class="md-nav__toggle md-toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5">
    
    <label class="md-nav__link" for="nav-5">
      管理文档
      <span class="md-nav__icon md-icon">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>
      </span>
    </label>
    <nav class="md-nav" aria-label="管理文档" data-md-level="1">
      <label class="md-nav__title" for="nav-5">
        <span class="md-nav__icon md-icon">
          <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
        </span>
        管理文档
      </label>
      <ul class="md-nav__list" data-md-scrollfix>
        
        
          
          
          


  <li class="md-nav__item">
    <a href="../../admin-guide/quick_start/" title="快速入门" class="md-nav__link">
      快速入门
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item md-nav__item--nested">
    
      <input class="md-nav__toggle md-toggle" data-md-toggle="nav-5-2" type="checkbox" id="nav-5-2">
    
    <label class="md-nav__link" for="nav-5-2">
      更新升级
      <span class="md-nav__icon md-icon">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>
      </span>
    </label>
    <nav class="md-nav" aria-label="更新升级" data-md-level="2">
      <label class="md-nav__title" for="nav-5-2">
        <span class="md-nav__icon md-icon">
          <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
        </span>
        更新升级
      </label>
      <ul class="md-nav__list" data-md-scrollfix>
        
        
          
          
          


  <li class="md-nav__item">
    <a href="../../admin-guide/upgrade/1.0.0-1.4.3/" title="1.0.0-1.4.3 升级到 1.4.4" class="md-nav__link">
      1.0.0-1.4.3 升级到 1.4.4
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../admin-guide/upgrade/1.4.4/" title="1.4.4 升级到 1.4.5" class="md-nav__link">
      1.4.4 升级到 1.4.5
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../admin-guide/upgrade/1.4.5-1.4.10/" title="1.4.5-1.4.10 升级到 最新" class="md-nav__link">
      1.4.5-1.4.10 升级到 最新
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../admin-guide/upgrade/1.5.0/" title="1.5.0 及之后版本升级到 最新" class="md-nav__link">
      1.5.0 及之后版本升级到 最新
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../admin-guide/upgrade/other/" title="其他部署方式升级说明" class="md-nav__link">
      其他部署方式升级说明
    </a>
  </li>

        
      </ul>
    </nav>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../admin-guide/migration/" title="迁移文档" class="md-nav__link">
      迁移文档
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item md-nav__item--nested">
    
      <input class="md-nav__toggle md-toggle" data-md-toggle="nav-5-4" type="checkbox" id="nav-5-4">
    
    <label class="md-nav__link" for="nav-5-4">
      资产要求
      <span class="md-nav__icon md-icon">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>
      </span>
    </label>
    <nav class="md-nav" aria-label="资产要求" data-md-level="2">
      <label class="md-nav__title" for="nav-5-4">
        <span class="md-nav__icon md-icon">
          <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
        </span>
        资产要求
      </label>
      <ul class="md-nav__list" data-md-scrollfix>
        
        
          
          
          


  <li class="md-nav__item">
    <a href="../../admin-guide/assets/telnet/" title="Tetnet" class="md-nav__link">
      Tetnet
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../admin-guide/assets/linux_ssh/" title="Linux SSH" class="md-nav__link">
      Linux SSH
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../admin-guide/assets/linux_vnc/" title="Linux VNC" class="md-nav__link">
      Linux VNC
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../admin-guide/assets/windows_ssh/" title="Windows SSH" class="md-nav__link">
      Windows SSH
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../admin-guide/assets/windows_vnc/" title="Windows VNC" class="md-nav__link">
      Windows VNC
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../admin-guide/assets/windows_rdp/" title="Windows RDP" class="md-nav__link">
      Windows RDP
    </a>
  </li>

        
      </ul>
    </nav>
  </li>

        
          
          
          


  <li class="md-nav__item md-nav__item--nested">
    
      <input class="md-nav__toggle md-toggle" data-md-toggle="nav-5-5" type="checkbox" id="nav-5-5">
    
    <label class="md-nav__link" for="nav-5-5">
      身份认证
      <span class="md-nav__icon md-icon">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>
      </span>
    </label>
    <nav class="md-nav" aria-label="身份认证" data-md-level="2">
      <label class="md-nav__title" for="nav-5-5">
        <span class="md-nav__icon md-icon">
          <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
        </span>
        身份认证
      </label>
      <ul class="md-nav__list" data-md-scrollfix>
        
        
          
          
          


  <li class="md-nav__item">
    <a href="../../admin-guide/authentication/cas/" title="CAS 认证" class="md-nav__link">
      CAS 认证
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../admin-guide/authentication/mfa/" title="MFA 认证" class="md-nav__link">
      MFA 认证
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../admin-guide/authentication/ldap/" title="LDAP 认证" class="md-nav__link">
      LDAP 认证
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../admin-guide/authentication/openid/" title="OpenID 认证" class="md-nav__link">
      OpenID 认证
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../admin-guide/authentication/radius/" title="Radius 认证" class="md-nav__link">
      Radius 认证
    </a>
  </li>

        
      </ul>
    </nav>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../admin-guide/organization/" title="组织管理" class="md-nav__link">
      组织管理
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../admin-guide/proxy/" title="反向代理" class="md-nav__link">
      反向代理
    </a>
  </li>

        
      </ul>
    </nav>
  </li>

    
      
      
      


  <li class="md-nav__item md-nav__item--nested">
    
      <input class="md-nav__toggle md-toggle" data-md-toggle="nav-6" type="checkbox" id="nav-6">
    
    <label class="md-nav__link" for="nav-6">
      开发文档
      <span class="md-nav__icon md-icon">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>
      </span>
    </label>
    <nav class="md-nav" aria-label="开发文档" data-md-level="1">
      <label class="md-nav__title" for="nav-6">
        <span class="md-nav__icon md-icon">
          <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
        </span>
        开发文档
      </label>
      <ul class="md-nav__list" data-md-scrollfix>
        
        
          
          
          


  <li class="md-nav__item">
    <a href="../../dev/rest_api/" title="API文档" class="md-nav__link">
      API文档
    </a>
  </li>

        
      </ul>
    </nav>
  </li>

    
      
      
      


  <li class="md-nav__item">
    <a href="../../issues/list/" title="问题清单" class="md-nav__link">
      问题清单
    </a>
  </li>

    
      
      
      


  <li class="md-nav__item md-nav__item--nested">
    
      <input class="md-nav__toggle md-toggle" data-md-toggle="nav-8" type="checkbox" id="nav-8">
    
    <label class="md-nav__link" for="nav-8">
      用户文档
      <span class="md-nav__icon md-icon">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>
      </span>
    </label>
    <nav class="md-nav" aria-label="用户文档" data-md-level="1">
      <label class="md-nav__title" for="nav-8">
        <span class="md-nav__icon md-icon">
          <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
        </span>
        用户文档
      </label>
      <ul class="md-nav__list" data-md-scrollfix>
        
        
          
          
          


  <li class="md-nav__item">
    <a href="../../user-guide/assets/user-asset/" title="我的资产" class="md-nav__link">
      我的资产
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item md-nav__item--nested">
    
      <input class="md-nav__toggle md-toggle" data-md-toggle="nav-8-2" type="checkbox" id="nav-8-2">
    
    <label class="md-nav__link" for="nav-8-2">
      我的应用
      <span class="md-nav__icon md-icon">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>
      </span>
    </label>
    <nav class="md-nav" aria-label="我的应用" data-md-level="2">
      <label class="md-nav__title" for="nav-8-2">
        <span class="md-nav__icon md-icon">
          <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
        </span>
        我的应用
      </label>
      <ul class="md-nav__list" data-md-scrollfix>
        
        
          
          
          


  <li class="md-nav__item">
    <a href="../../user-guide/applications/user-database-app/" title="数据库应用" class="md-nav__link">
      数据库应用
    </a>
  </li>

        
      </ul>
    </nav>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../user-guide/ops/command-executions/create/" title="命令执行" class="md-nav__link">
      命令执行
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../user-guide/users/profile/" title="个人信息" class="md-nav__link">
      个人信息
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../user-guide/terminal/web-terminal/" title="Web终端" class="md-nav__link">
      Web终端
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../user-guide/terminal/web-sftp/" title="文件管理" class="md-nav__link">
      文件管理
    </a>
  </li>

        
      </ul>
    </nav>
  </li>

    
      
      
      


  <li class="md-nav__item md-nav__item--nested">
    
      <input class="md-nav__toggle md-toggle" data-md-toggle="nav-9" type="checkbox" id="nav-9">
    
    <label class="md-nav__link" for="nav-9">
      帮助文档
      <span class="md-nav__icon md-icon">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>
      </span>
    </label>
    <nav class="md-nav" aria-label="帮助文档" data-md-level="1">
      <label class="md-nav__title" for="nav-9">
        <span class="md-nav__icon md-icon">
          <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
        </span>
        帮助文档
      </label>
      <ul class="md-nav__list" data-md-scrollfix>
        
        
          
          
          


  <li class="md-nav__item">
    <a href="../../faq/core/" title="Core 常见问题" class="md-nav__link">
      Core 常见问题
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../faq/luna/" title="Luna 常见问题" class="md-nav__link">
      Luna 常见问题
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../faq/koko/" title="koko 常见问题" class="md-nav__link">
      koko 常见问题
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../faq/guacamole/" title="Guacamole 问题" class="md-nav__link">
      Guacamole 问题
    </a>
  </li>

        
      </ul>
    </nav>
  </li>

    
      
      
      


  <li class="md-nav__item md-nav__item--nested">
    
      <input class="md-nav__toggle md-toggle" data-md-toggle="nav-10" type="checkbox" id="nav-10">
    
    <label class="md-nav__link" for="nav-10">
      关于
      <span class="md-nav__icon md-icon">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>
      </span>
    </label>
    <nav class="md-nav" aria-label="关于" data-md-level="1">
      <label class="md-nav__title" for="nav-10">
        <span class="md-nav__icon md-icon">
          <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
        </span>
        关于
      </label>
      <ul class="md-nav__list" data-md-scrollfix>
        
        
          
          
          


  <li class="md-nav__item">
    <a href="../../about/contributor/" title="贡献列表" class="md-nav__link">
      贡献列表
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../about/change_log/" title="更新说明" class="md-nav__link">
      更新说明
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../about/contact/" title="联系方式" class="md-nav__link">
      联系方式
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../about/commercial/" title="商业产品" class="md-nav__link">
      商业产品
    </a>
  </li>

        
      </ul>
    </nav>
  </li>

    
  </ul>
</nav>
                  </div>
                </div>
              </div>
            
            
              <div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
                <div class="md-sidebar__scrollwrap">
                  <div class="md-sidebar__inner">
                    
<nav class="md-nav md-nav--secondary" aria-label="目录">
  
  
    
  
  
    <label class="md-nav__title" for="__toc">
      <span class="md-nav__icon md-icon">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
      </span>
      目录
    </label>
    <ul class="md-nav__list" data-md-scrollfix>
      
        <li class="md-nav__item">
  <a href="#yum-docker" class="md-nav__link">
    Yum 安装 Docker
  </a>
  
    <nav class="md-nav" aria-label="Yum 安装 Docker">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#1" class="md-nav__link">
    1. 关闭 &amp;&amp; 禁用 防火墙
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#2-selinux" class="md-nav__link">
    2. 关闭 &amp;&amp; 禁用 Selinux
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#3-docker" class="md-nav__link">
    3. 添加 Docker 软件源
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#4-docker-ce" class="md-nav__link">
    4. 安装 Docker CE
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#5-docker" class="md-nav__link">
    5. 创建 Docker 配置文件
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#6-docker" class="md-nav__link">
    6. 启动 Docker 服务并设置开机启动
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#7" class="md-nav__link">
    7. 安装命令补全
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
      
        <li class="md-nav__item">
  <a href="#docker_1" class="md-nav__link">
    二进制安装 Docker
  </a>
  
    <nav class="md-nav" aria-label="二进制安装 Docker">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#1_1" class="md-nav__link">
    1. 关闭 &amp;&amp; 禁用 防火墙
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#2-selinux_1" class="md-nav__link">
    2. 关闭 &amp;&amp; 禁用 Selinux
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#3" class="md-nav__link">
    3. 获取最新稳定版本号
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#4" class="md-nav__link">
    4. 下载二进制安装包
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#5" class="md-nav__link">
    5. 解压 &amp;&amp; 配置
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#6" class="md-nav__link">
    6. 创建服务
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#7-docker" class="md-nav__link">
    7. 启动 Docker 服务并设置开机启动
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#8" class="md-nav__link">
    8. 配置命令补全
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
      
        <li class="md-nav__item">
  <a href="#docker-compose" class="md-nav__link">
    二进制安装 docker-compose
  </a>
  
    <nav class="md-nav" aria-label="二进制安装 docker-compose">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#1_2" class="md-nav__link">
    1. 获取最新版本号
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#2" class="md-nav__link">
    2. 下载 &amp;&amp; 安装
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#3_1" class="md-nav__link">
    3. 配置命令补全
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
      
        <li class="md-nav__item">
  <a href="#_1" class="md-nav__link">
    使用脚本安装(二进制)
  </a>
  
    <nav class="md-nav" aria-label="使用脚本安装(二进制)">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#1-docker-ce" class="md-nav__link">
    1. 安装 Docker CE
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#2-docker-compose" class="md-nav__link">
    2. 安装 docker-compose
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
      
    </ul>
  
</nav>
                  </div>
                </div>
              </div>
            
          
          <div class="md-content">
            <article class="md-content__inner md-typeset">
              
                
                
                  
                
                
                <h1 id="docker">Docker 安装<a class="headerlink" href="#docker" title="Permanent link">&para;</a></h1>
<div class="admonition info">
<p class="admonition-title">本教程适用系统 CentOS 7</p>
</div>
<div class="admonition tip">
<p class="admonition-title">Docker 官方文档 <a href="https://docs.docker.com">https://docs.docker.com</a></p>
</div>
<div class="admonition tip">
<p class="admonition-title">Docker 官方安装文档 <a href="https://docs.docker.com/engine/install">https://docs.docker.com/engine/install</a></p>
</div>
<h2 id="yum-docker">Yum 安装 Docker<a class="headerlink" href="#yum-docker" title="Permanent link">&para;</a></h2>
<h3 id="1">1. 关闭 &amp;&amp; 禁用 防火墙<a class="headerlink" href="#1" title="Permanent link">&para;</a></h3>
<div class="highlight"><pre><span></span><code>systemctl stop firewalld
systemctl disable firewalld
</code></pre></div>

<h3 id="2-selinux">2. 关闭 &amp;&amp; 禁用 Selinux<a class="headerlink" href="#2-selinux" title="Permanent link">&para;</a></h3>
<div class="highlight"><pre><span></span><code>setenforce <span class="m">0</span>
sed -i <span class="s1">&#39;s/SELINUX=enforcing/SELINUX=disabled/g&#39;</span> /etc/selinux/config
</code></pre></div>

<h3 id="3-docker">3. 添加 Docker 软件源<a class="headerlink" href="#3-docker" title="Permanent link">&para;</a></h3>
<div class="highlight"><pre><span></span><code>curl -so /etc/yum.repos.d/docker-ce.repo <span class="se">\</span>
  http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
</code></pre></div>

<h3 id="4-docker-ce">4. 安装 Docker CE<a class="headerlink" href="#4-docker-ce" title="Permanent link">&para;</a></h3>
<div class="highlight"><pre><span></span><code>yum install -y docker-ce
</code></pre></div>

<h3 id="5-docker">5. 创建 Docker 配置文件<a class="headerlink" href="#5-docker" title="Permanent link">&para;</a></h3>
<details class="info"><summary>参数说明</summary><div class="highlight"><pre><span></span><code>&quot;registry-mirrors&quot;: [&quot;http://hub-mirror.c.163.com&quot;],  # 镜像加速
&quot;insecure-registries&quot;: [&quot;192.168.2.30&quot;],              # 信任 http 协议镜像仓库
&quot;max-concurrent-downloads&quot;: 20,                       # 下载镜像时最大连接数
&quot;log-driver&quot;: &quot;json-file&quot;,                            # docker 日志类型
&quot;data-root&quot;: &quot;/var/lib/docker&quot;,                       # docker 镜像及数据存储路径
</code></pre></div>

</details>
<div class="highlight"><pre><span></span><code>mkdir -p /etc/docker
cat &gt; /etc/docker/daemon.json <span class="s">&lt;&lt;-EOF</span>
<span class="s">{ </span>
<span class="s">  &quot;registry-mirrors&quot;: [&quot;http://hub-mirror.c.163.com&quot;],</span>
<span class="s">  &quot;max-concurrent-downloads&quot;: 20,</span>
<span class="s">  &quot;log-driver&quot;: &quot;json-file&quot;,</span>
<span class="s">  &quot;log-level&quot;: &quot;warn&quot;,</span>
<span class="s">  &quot;log-opts&quot;: {</span>
<span class="s">    &quot;max-size&quot;: &quot;10m&quot;,</span>
<span class="s">    &quot;max-file&quot;: &quot;3&quot;</span>
<span class="s">    },</span>
<span class="s">  &quot;data-root&quot;: &quot;/var/lib/docker&quot;</span>
<span class="s">}</span>
<span class="s">EOF</span>
</code></pre></div>

<h3 id="6-docker">6. 启动 Docker 服务并设置开机启动<a class="headerlink" href="#6-docker" title="Permanent link">&para;</a></h3>
<div class="highlight"><pre><span></span><code>systemctl start docker
systemctl <span class="nb">enable</span> docker
</code></pre></div>

<h3 id="7">7. 安装命令补全<a class="headerlink" href="#7" title="Permanent link">&para;</a></h3>
<div class="highlight"><pre><span></span><code>yum install -y bash-completion
</code></pre></div>

<div class="admonition info">
<p class="admonition-title">bash-completion 包安装后请重新打开终端或者在终端输入 bash 重新载入系统环境.</p>
</div>
<h2 id="docker_1">二进制安装 Docker<a class="headerlink" href="#docker_1" title="Permanent link">&para;</a></h2>
<h3 id="1_1">1. 关闭 &amp;&amp; 禁用 防火墙<a class="headerlink" href="#1_1" title="Permanent link">&para;</a></h3>
<div class="highlight"><pre><span></span><code>systemctl stop firewalld
systemctl disable firewalld
</code></pre></div>

<h3 id="2-selinux_1">2. 关闭 &amp;&amp; 禁用 Selinux<a class="headerlink" href="#2-selinux_1" title="Permanent link">&para;</a></h3>
<div class="highlight"><pre><span></span><code>setenforce <span class="m">0</span>
sed -i <span class="s1">&#39;s/SELINUX=enforcing/SELINUX=disabled/g&#39;</span> /etc/selinux/config
</code></pre></div>

<h3 id="3">3. 获取最新稳定版本号<a class="headerlink" href="#3" title="Permanent link">&para;</a></h3>
<div class="highlight"><pre><span></span><code><span class="nv">DOCKER_VER</span><span class="o">=</span><span class="k">$(</span>curl -s http://mirror.azure.cn/docker-ce/linux/static/stable/x86_64/ <span class="p">|</span> <span class="se">\</span>
  egrep -i -o <span class="s1">&#39;href=&quot;docker-[0-9]+.[0-9]+.[0-9]+&#39;</span> <span class="p">|</span> <span class="se">\</span>
  sed <span class="s1">&#39;s/href=&quot;docker-//&#39;</span> <span class="p">|</span> tail -n1<span class="k">)</span>
</code></pre></div>

<h3 id="4">4. 下载二进制安装包<a class="headerlink" href="#4" title="Permanent link">&para;</a></h3>
<div class="highlight"><pre><span></span><code>curl -C- -O --retry <span class="m">3</span> --progress <span class="se">\</span>
  http://mirror.azure.cn/docker-ce/linux/static/stable/x86_64/docker-<span class="si">${</span><span class="nv">DOCKER_VER</span><span class="si">}</span>.tgz
</code></pre></div>

<h3 id="5">5. 解压 &amp;&amp; 配置<a class="headerlink" href="#5" title="Permanent link">&para;</a></h3>
<div class="admonition info">
<p class="admonition-title">解压 &amp;&amp; 创建二进制文件软链接.  DOCKER_HOME : docke 安装路径可自定义.</p>
</div>
<div class="highlight"><pre><span></span><code><span class="nv">DOCKER_HOME</span><span class="o">=</span>/usr/local/docker
mkdir -p <span class="si">${</span><span class="nv">DOCKER_HOME</span><span class="si">}</span>/bin
tar zxf docker-<span class="si">${</span><span class="nv">DOCKER_VER</span><span class="si">}</span>.tgz -C <span class="nv">$DOCKER_HOME</span>/bin --strip-components <span class="m">1</span>
ln -sf <span class="si">${</span><span class="nv">DOCKER_HOME</span><span class="si">}</span>/bin/* /usr/local/bin/
</code></pre></div>

<div class="admonition info">
<p class="admonition-title">创建 Docker 配置文件</p>
</div>
<details class="info"><summary>参数说明</summary><div class="highlight"><pre><span></span><code>&quot;registry-mirrors&quot;: [&quot;http://hub-mirror.c.163.com&quot;],  # 镜像加速
&quot;insecure-registries&quot;: [&quot;192.168.2.30&quot;],              # 信任 http 协议镜像仓库
&quot;max-concurrent-downloads&quot;: 20,                       # 下载镜像时最大连接数
&quot;log-driver&quot;: &quot;json-file&quot;,                            # docker 日志类型
&quot;data-root&quot;: &quot;/var/lib/docker&quot;,                       # docker 镜像及数据存储路径 
</code></pre></div>

</details>
<div class="highlight"><pre><span></span><code>mkdir -p /etc/docker
cat &gt; /etc/docker/daemon.json <span class="s">&lt;&lt;-EOF</span>
<span class="s">{</span>
<span class="s">  &quot;registry-mirrors&quot;: [&quot;http://hub-mirror.c.163.com&quot;],</span>
<span class="s">  &quot;max-concurrent-downloads&quot;: 20,</span>
<span class="s">  &quot;log-driver&quot;: &quot;json-file&quot;,</span>
<span class="s">  &quot;log-level&quot;: &quot;warn&quot;,</span>
<span class="s">  &quot;log-opts&quot;: {</span>
<span class="s">    &quot;max-size&quot;: &quot;10m&quot;,</span>
<span class="s">    &quot;max-file&quot;: &quot;3&quot;</span>
<span class="s">    },</span>
<span class="s">  &quot;data-root&quot;: &quot;/var/lib/docker&quot;</span>
<span class="s">}</span>
<span class="s">EOF</span>
</code></pre></div>

<h3 id="6">6. 创建服务<a class="headerlink" href="#6" title="Permanent link">&para;</a></h3>
<div class="highlight"><pre><span></span><code>cat &gt; /etc/systemd/system/docker.service <span class="s">&lt;&lt;-EOF</span>
<span class="s">[Unit]</span>
<span class="s">Description=Docker Application Container Engine</span>
<span class="s">Documentation=http://docs.docker.io</span>

<span class="s">[Service]</span>
<span class="s">Environment=&quot;PATH=$DOCKER_HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin&quot;</span>
<span class="s">ExecStart=$DOCKER_HOME/bin/dockerd</span>
<span class="s">ExecReload=/bin/kill -s HUP \$MAINPID</span>
<span class="s">Restart=on-failure</span>
<span class="s">LimitNOFILE=infinity</span>
<span class="s">LimitNPROC=infinity</span>
<span class="s">LimitCORE=infinity</span>
<span class="s">Delegate=yes</span>
<span class="s">KillMode=process</span>

<span class="s">TimeoutSec=0</span>
<span class="s">RestartSec=2</span>
<span class="s">Restart=always</span>
<span class="s">StartLimitBurst=3</span>
<span class="s">StartLimitInterval=60s</span>

<span class="s">[Install]</span>
<span class="s">WantedBy=multi-user.target</span>
<span class="s">EOF</span>
</code></pre></div>

<h3 id="7-docker">7. 启动 Docker 服务并设置开机启动<a class="headerlink" href="#7-docker" title="Permanent link">&para;</a></h3>
<div class="highlight"><pre><span></span><code>systemctl daemon-reload
systemctl <span class="nb">enable</span> docker
systemctl restart docker
</code></pre></div>

<h3 id="8">8. 配置命令补全<a class="headerlink" href="#8" title="Permanent link">&para;</a></h3>
<div class="highlight"><pre><span></span><code>curl -sSL -o /etc/bash_completion.d/docker <span class="se">\</span>
  https://gitee.com/yx571304/olz/raw/master/shell/docker/docker
curl -sSL -o /usr/share/bash-completion/bash_completion <span class="se">\</span>
  https://gitee.com/yx571304/olz/raw/master/shell/docker/bash_completion
<span class="nb">echo</span> -e <span class="s2">&quot;\nsource /usr/share/bash-completion/bash_completion&quot;</span> &gt;&gt; ~/.bashrc
</code></pre></div>

<div class="admonition info">
<p class="admonition-title">在终端输入 source ~/.bashrc 重新读取环境变量.</p>
</div>
<h2 id="docker-compose">二进制安装 docker-compose<a class="headerlink" href="#docker-compose" title="Permanent link">&para;</a></h2>
<h3 id="1_2">1. 获取最新版本号<a class="headerlink" href="#1_2" title="Permanent link">&para;</a></h3>
<div class="highlight"><pre><span></span><code><span class="nv">COMPOSE_VER</span><span class="o">=</span><span class="k">$(</span> <span class="se">\</span>
  curl -sSL https://api.github.com/repos/docker/compose/releases/latest <span class="p">|</span> <span class="se">\</span>
  grep <span class="s1">&#39;&quot;name&quot;&#39;</span> <span class="p">|</span> <span class="se">\</span>
  head -n <span class="m">1</span> <span class="p">|</span> <span class="se">\</span>
  awk -F <span class="s2">&quot;:&quot;</span> <span class="s1">&#39;{print $2}&#39;</span> <span class="p">|</span> <span class="se">\</span>
  sed <span class="s1">&#39;s/\&quot;//g;s/,//g;s/ //g&#39;</span><span class="k">)</span>
</code></pre></div>

<h3 id="2">2. 下载 &amp;&amp; 安装<a class="headerlink" href="#2" title="Permanent link">&para;</a></h3>
<div class="highlight"><pre><span></span><code>curl -L https://get.daocloud.io/docker/compose/releases/download/<span class="si">${</span><span class="nv">COMPOSE_VER</span><span class="si">}</span>/docker-compose-<span class="sb">`</span>uname -s<span class="sb">`</span>-<span class="sb">`</span>uname -m<span class="sb">`</span> <span class="se">\</span>
  &gt; /usr/local/bin/docker-compose --progress
chmod +x /usr/local/bin/docker-compose
</code></pre></div>

<h3 id="3_1">3. 配置命令补全<a class="headerlink" href="#3_1" title="Permanent link">&para;</a></h3>
<div class="highlight"><pre><span></span><code>curl -sSL -o /etc/bash_completion.d/docker-compose <span class="se">\</span>
  https://gitee.com/yx571304/olz/raw/master/shell/docker/docker-compose
</code></pre></div>

<h2 id="_1">使用脚本安装(二进制)<a class="headerlink" href="#_1" title="Permanent link">&para;</a></h2>
<h3 id="1-docker-ce">1. 安装 Docker CE<a class="headerlink" href="#1-docker-ce" title="Permanent link">&para;</a></h3>
<div class="codehilite"><pre><span></span><code><span class="o">#</span> <span class="err">安装最新版本</span> <span class="n">Docker</span> <span class="n">CE</span>
<span class="n">bash</span> <span class="o">&lt;</span><span class="p">(</span><span class="n">curl</span> <span class="o">-</span><span class="n">sSL</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">dwz</span><span class="p">.</span><span class="n">cn</span><span class="o">/</span><span class="n">XOJj0Njx</span><span class="p">)</span> <span class="o">-</span><span class="n">i</span> <span class="n">docker</span>

<span class="o">#</span> <span class="err">安装指定版本</span> <span class="n">Docker</span> <span class="n">CE</span>
<span class="n">bash</span> <span class="o">&lt;</span><span class="p">(</span><span class="n">curl</span> <span class="o">-</span><span class="n">sSL</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">dwz</span><span class="p">.</span><span class="n">cn</span><span class="o">/</span><span class="n">XOJj0Njx</span><span class="p">)</span> <span class="o">-</span><span class="n">i</span> <span class="n">docker</span> <span class="o">-</span><span class="n">v</span> <span class="mi">19</span><span class="p">.</span><span class="mi">03</span><span class="p">.</span><span class="mi">3</span>
</code></pre></div>


<h3 id="2-docker-compose">2. 安装 docker-compose<a class="headerlink" href="#2-docker-compose" title="Permanent link">&para;</a></h3>
<div class="codehilite"><pre><span></span><code><span class="err">bash &lt;(curl -sSL https://dwz.cn/XOJj0Njx) -i compose</span>
</code></pre></div>
                
              
              
                


              
            </article>
          </div>
        </div>
      </main>
      
        
<footer class="md-footer">
  
    <div class="md-footer-nav">
      <nav class="md-footer-nav__inner md-grid" aria-label="Footer">
        
          <a href="../.." title="总体介绍" class="md-footer-nav__link md-footer-nav__link--prev" rel="prev">
            <div class="md-footer-nav__button md-icon">
              <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
            </div>
            <div class="md-footer-nav__title">
              <div class="md-ellipsis">
                <span class="md-footer-nav__direction">
                  上一页
                </span>
                总体介绍
              </div>
            </div>
          </a>
        
        
          <a href="../harbor/" title="harbor 安装" class="md-footer-nav__link md-footer-nav__link--next" rel="next">
            <div class="md-footer-nav__title">
              <div class="md-ellipsis">
                <span class="md-footer-nav__direction">
                  下一页
                </span>
                harbor 安装
              </div>
            </div>
            <div class="md-footer-nav__button md-icon">
              <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4z"/></svg>
            </div>
          </a>
        
      </nav>
    </div>
  
  <div class="md-footer-meta md-typeset">
    <div class="md-footer-meta__inner md-grid">
      <div class="md-footer-copyright">
        
        Made with
        <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
          Material for MkDocs
        </a>
      </div>
      
    </div>
  </div>
</footer>
      
    </div>
    
      <script src="../../assets/javascripts/vendor.d710d30a.min.js"></script>
      <script src="../../assets/javascripts/bundle.4a5ba8d6.min.js"></script><script id="__lang" type="application/json">{"clipboard.copy": "\u590d\u5236", "clipboard.copied": "\u5df2\u590d\u5236", "search.config.lang": "ja", "search.config.pipeline": "trimmer, stemmer", "search.config.separator": "[\\uff0c\\u3002]+", "search.result.placeholder": "\u952e\u5165\u4ee5\u5f00\u59cb\u641c\u7d22", "search.result.none": "\u6ca1\u6709\u627e\u5230\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.one": "\u627e\u5230 1 \u4e2a\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.other": "# \u4e2a\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c"}</script>
      
      <script>
        app = initialize({
          base: "../..",
          features: [],
          search: Object.assign({
            worker: "../../assets/javascripts/worker/search.9b3611bd.min.js"
          }, typeof search !== "undefined" && search)
        })
      </script>
      
    
  </body>
</html>